
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<script src="../js/vue.min.js"></script>
		<script src="../js/vant.min.js"></script>
		<script src="../js/ajax.js"></script>
		<link rel="stylesheet" href="../css/index.css" />
		<script src="html5plus://ready"></script>
		<script src="../js/listener_other.js"></script>
		<title>新用户注册</title>
	</head>
	<body placeholder="nihao">
		<div id="app">
			<van-row style="background-color:orangered; height:100px;line-height:46px;padding-top: 2%;">
			  <van-col span="2" offset="1" ><van-icon color="white" name="arrow-left" size="20px" style="margin-top: 29px;" /></van-col>
			 <van-col span="10" offset="4"><h2 style="color:white" >新用户注册</h2></van-col>
			 
			</van-row>
			<van-row style="margin-top:3% ;">
			 	  <van-col span="18" offset="2" >
			 	  	<input type="text" placeholder="请输入手机号" id="phone" v-model="phone"  name="phone" style="border: none;" /></van-col>
			   </van-row>
			 <van-row style="margin-top:5% ;">
			 	  <van-col span="14" offset="2" ><input type="text" placeholder="验证码(六位数字验证码)" v-model="yanzheng" id="yanzhengma"  name="yanzhengma" style="border: none;" /></van-col>
				  <van-col span="7" ><van-button type="danger" @click="yanzhengma" size="large">获取验证码</van-button></van-col>
				 
			 </van-row>
			   <van-row style="margin-top:3% ;">
			 	  <van-col span="18" offset="2" >
			 	  	<input type="text" placeholder="登录密码（最少六位）" v-model="passwords" id="paswd" name="paswd" style="border: none;" /></van-col>
			   </van-row>
			 <van-row style="margin-top:8% ;">
			 	  <van-col span="18" offset="2" >
			 	  	<input type="text" placeholder="确认密码（再次输入登录密码）" v-model="passwordss" id="paswds" name="paswds" style="border: none;" /></van-col>
			 </van-row>
			 <van-row style="margin-top:8% ;">
			 	  <van-col span="18" offset="2" >
			 	  	<input type="text" placeholder="昵称（最多二十字）" v-model="nicheng" id="name" name="name" style="border: none;" /></van-col>
			 </van-row>
			 <van-row style="margin-top:8% ;">
			 	  <van-col span="18" offset="2" >
			 	  	<input type="text" placeholder="县/区（code）" v-model="diyu" id="xianqu" name="xianqu" style="border: none;" /></van-col>
			 </van-row>
			 <van-row style="margin-top:10% ;">
			 	  <van-col span="22" offset="2" >
			 	  	注册及表示同意<a href="" style="color: blue;"><<万众雅讯用户注册协议>></a>
			 	  	</van-col>
				  
				 
			 </van-row>
			  <van-row style="margin-top:10% ;">
			 	  <van-col span="20" offset="2" >
			 	  	<van-button type="danger" @click="zhuce" size="large">注册</van-button>
			 	  	</van-col>
				  
				 
			 </van-row>
			  
			<van-row style="background-color: white;margin-top: 10%;">
				<van-col offset="1" span="22">

					
				</van-col>

				

			</van-row>

		</div>
		<script type="text/javascript">
		

			var vm = new Vue({

				el: "#app",

				data: {
					phone:"",
					yanzheng:"",
					passwords:"",
					passwordss: "",
					nicheng:"",
					diyu:"",
					phone: ""

				},

				methods: {
					yanzhengma:function(){
						var a=parseInt(this.phone);
						
						ajax({
							url: "http://dsapi.ysd3g.com/API/SendRegisterPhoneCode",
							dataType:"jsonp",
							data: {
								phone:a,
								dataCode:this.yanzheng
							},
							"success": function(res) {
									
									if(res.Error==false){
									
									alert(res.Code)
								}else{
									
									alert(res.Msg)
								}
								
							}

						})
					
					},
					zhuce: function(res) {

						
						ajax({
							url: "http://dsapi.ysd3g.com/API/UserRegister",
							dataType:"jsonp",
							data: {
								phone:this.phone,
								password:this.passwords,
								nickName:this.nicheng,
								districtCode:this.diyu,
								code:this.yanzheng
							},
							"success": function(res) {
									
								if(res.Error){
									alert(res.Msg)
								}else{
									alert("注册成功"+res.Msg);
									var zhucexinxi=plus.webview.currentWebview();
									plus.webview.close(zhucexinxi);
									
								}
							}

						})
					}
				}

			});
		</script>
	</body>
</html>